package cn.edu.ctbu.sbadmin.lablog.tools;

import java.util.Date;

public class lablogHelper {

    /**
     * 将指定日期转化为学期开头的第几周的周几
     * @param converDate
     * @param startDate
     * @return
     */
    public static Integer[] converdate2Week(Date converDate,Date startDate){

        Integer[] rs=new Integer[2];
        Long day=(converDate.getTime()-startDate.getTime())/(24*60*60*1000);

        int weeks=day.intValue()/7;//从第1周开始
        int dayOfweek=day.intValue()%7;//因为从周一开始，所以+1

        rs[0]=weeks+1;
        rs[1]=dayOfweek+1;

        return rs;
    }
}
